// pages/remark/index.js
import {handlerGobackClick} from "../../../utils/util";

Page({

  /**
   * 页面的初始数据
   */
  data: {
    autoSize:{ minHeight: 130},
    message:"",
    prevPage:null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if(options.remark){
      this.setData({
        message:options.remark
      })
    }
  },
  onShow(){
    let curPages = getCurrentPages()  //获取当前页面js里的所有信息
    let prevPage = curPages[curPages.length - 2]
    this.setData({
      prevPage
    })
  },
  onChange(e){
    this.setData({
      message:e.detail
    })
  },
  handlerGobackClick,
  saveRemark(){
    this.data.prevPage.setData({
      remark:this.data.message
    })
    wx.navigateBack()
  }
})
